// 此文件用于配置项和相关参数设置

// 详情展示页
// 基本信息
// 基础信息模块
const detailInfo = [{
  label: '设备名称',
  name: 'deviceName',
  value: ''
}, {
  label: '固定资产编码',
  name: 'fixAssetCode',
  value: ''
}, {
  label: '设备编号',
  name: 'deviceNumber',
  value: ''
}, {
  label: '设备类别',
  name: 'deviceType',
  value: ''
}, {
  label: '设备分类',
  name: 'deviceClass',
  value: ''
}, {
  label: '使用部门',
  name: 'useDepartment',
  value: ''
}, {
  label: '责任人',
  name: 'responsible',
  value: ''
}, {
  label: '投产日期',
  name: 'productDate',
  value: ''
}, {
  label: '出厂编号',
  name: 'factoryNumber',
  value: ''
}, {
  label: '型号',
  name: 'model',
  value: ''
}, {
  label: '设备原值',
  name: 'deviceValue',
  value: ''
}, {
  label: '使用年限',
  name: 'usedYears',
  value: ''
}

]

const detailShowInfo = { title: '基础信息', content: detailInfo }
const checkDeviceShowInfo = {
  title: '点检设备',
  content: [{
    label: '设备名称',
    name: 'deviceName',
    value: '1'
  }, {
    label: '固定资产编码',
    name: 'fixAssetCode',
    value: '1'
  }, {
    label: '设备编号',
    name: 'deviceNumber',
    value: '1'
  }, {
    label: '设备类别',
    name: 'deviceType',
    value: '1'
  }, {
    label: '设备分类',
    name: 'deviceClass',
    value: '1'
  }],
  tableColumns: [
    { prop: 'id', label: '序号', width: 140 },
    { prop: 'name', label: '计划名称', minWidth: 180 },

    {
      prop: 'deviceName',
      label: '设备名称',
      width: 100
      // render: (row) => {
      //   const { deviceInfo } = row;
      //   return deviceInfo.name ? deviceInfo.name :"";
      // },
    },
    {
      prop: 'deviceNumber',
      label: '设备名称',
      width: 100
    },
    { prop: 'departmentName', label: '使用部门', minWidth: 180 }
  ],
  tableData: []
}
const checkOperateShowInfo = {
  title: '点检员',
  content: '',
  tableColumns: [
    { prop: 'id', label: '序号', width: 140 },
    { prop: 'name', label: '计划名称', minWidth: 180 },

    {
      prop: 'deviceName',
      label: '设备名称',
      width: 100
      // render: (row) => {
      //   const { deviceInfo } = row;
      //   return deviceInfo.name ? deviceInfo.name :"";
      // },
    },
    {
      prop: 'deviceNumber',
      label: '设备名称',
      width: 100
    },
    { prop: 'departmentName', label: '使用部门', minWidth: 180 }
  ],
  tableData: []
}
const checkItemsShowInfo = {
  title: '点检项',
  content: '',
  tableColumns: [
    { prop: 'id', label: '序号', width: 140 },
    { prop: 'name', label: '计划名称', minWidth: 180 },

    {
      prop: 'deviceName',
      label: '设备名称',
      width: 100
      // render: (row) => {
      //   const { deviceInfo } = row;
      //   return deviceInfo.name ? deviceInfo.name :"";
      // },
    },
    {
      prop: 'deviceNumber',
      label: '设备名称',
      width: 100
    },
    { prop: 'departmentName', label: '使用部门', minWidth: 180 }
  ],
  tableData: []
}
// 基础信息表单配置
const formData = {
  title: '基础信息',
  formModel: {
    deviceId: '1',
    deviceName: '1',
    planPeriodType: '',
    planPeriodBegin: '',
    planPeriodTotal: '2',
    planPeriodTotal1: '1',
    planPeriodTotalValue: '',
    planPeriodTotalUnit: ''
  },
  formComponent: [{
    type: 'input',
    label: '计划名称',
    model: 'deviceName',
    keyUpEnter: 'handleFilter',
    rules: [{ required: true, message: '请输入计划名称', trigger: 'blur' }]
  },
  {
    span: 18,
    type: 'select',
    label: '计划周期类别',
    model: 'planPeriodType',
    option: [{ label: '定期', value: '0' }, { label: '日常', value: '1' }],
    rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]

  },
  {
    span: 5,
    type: 'datePicker',
    label: '计划开始时间',
    model: 'planPeriodBegin',
    option: [1, 2, 3],
    rules: [{ required: true, message: '请输入计划开始时间', trigger: 'blur' }]
  },
  {
    span: 8,
    type: 'selectRadio',
    label: '周期',
    model: 'planPeriodTotal',
    value: 'planPeriodTotalValue',
    unit: 'planPeriodTotalUnit',
    option: [{ label: '天', value: 'day' }, { label: '周', value: 'week' }, { label: '月', value: 'month' }],
    rules: [{ required: true, message: '请输入计划周期', trigger: 'blur' }]
  },
  {
    span: 11,
    type: 'selectCheck',
    label: '跳过日期',
    model: 'planPeriodTotal1',
    option: [{ value: '1', label: '周一' }, { value: '2', label: '周二' }, { value: '3', label: '周三' }, { value: '4', label: '周四' }, { value: '5', label: '周五' }],
    rules: [{ required: true, message: '请输入计划周期', trigger: 'blur' }]
  }
  ],
  formComponent1: [{
    type: 'input',
    label: '计划名称',
    model: 'deviceName',
    keyUpEnter: 'handleFilter',
    rules: [{ required: true, message: '请输入计划名称', trigger: 'blur' }]
  },
  {
    span: 18,
    type: 'select',
    label: '计划周期类别',
    model: 'planPeriodType',
    option: [{ label: '定期', value: '0' }, { label: '日常', value: '1' }],
    rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]

  },
  {
    span: 5,
    type: 'datePicker',
    label: '计划开始时间',
    model: 'planPeriodBegin',
    option: [1, 2, 3],
    rules: [{ required: true, message: '请输入计划开始时间', trigger: 'blur' }]
  }
  ]
}
// 档案信息
const operateFormInfo = {
  title: '点检员',
  formModel: {
    fileTitle: ''
  },
  formComponent: [{
    type: 'select',
    label: '点检员类别',
    model: 'membType',
    option: [{ label: '指定人员', value: '0' }, { label: '指定部门', value: '1' }],
    rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
  }, {
    type: 'select',
    label: '选择点检员',
    model: 'membExt',
    option: [{ label: '张三', value: '0' }, { label: '李四', value: '1' }],
    rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
  }],
  formComponent1: [{
    type: 'select',
    label: '点检员类别',
    model: 'membType',
    option: [{ label: '指定人员', value: '0' }, { label: '指定部门', value: '1' }],
    rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
  }, {
    type: 'select',
    label: '选择指定部门',
    model: 'membExt',
    option: [{ label: '科技部', value: '0' }, { label: '事业发展部', value: '1' }],
    rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
  }]
}
// 整理后的表单配置
const deviceForm0 = [{
  formName: '计划基础信息',
  formRef: 'table1', // 表单ref
  formModel: formData.formModel, // 表单model
  formComponent: formData.formComponent,
  formName: formData.title // 表单标题
}]
const deviceForm1 = [{
  formName: '计划基础信息',
  formRef: 'table1', // 表单ref
  formModel: formData.formModel, // 表单model
  formComponent: formData.formComponent1,
  formName: formData.title // 表单标题
}]
const operateForm0 = [{
  formName: '点检员',
  formRef: 'table2', // 表单ref
  formModel: operateFormInfo.formModel, // 表单model
  formComponent: operateFormInfo.formComponent,
  formName: operateFormInfo.title // 表单标题
}]

const operateForm1 = [{
  formName: '点检员',
  formRef: 'table2', // 表单ref
  formModel: operateFormInfo.formModel, // 表单model
  formComponent: operateFormInfo.formComponent1,
  formName: operateFormInfo.title // 表单标题
}]

const data = {

  basicForm0: deviceForm0,
  basicForm1: deviceForm1,
  operateForm0: operateForm0,
  operateForm1: operateForm1,
  // ----------表单显示相关---------//
  // 计划基本信息
  detailShowInfo: detailShowInfo,
  // 点检设备
  checkDeviceShowInfo: checkDeviceShowInfo,
  // 点检员
  checkOperateShowInfo: checkOperateShowInfo,
  // 点检项
  checkItemsShowInfo: checkItemsShowInfo
}
export default data
